<template>
    <div>
      <h2>我是第二个页面</h2>
      <ol>
        <li v-for="item in listData" :key="item.t_nav_pk">{{ item.nav_name }}</li>
      </ol>
      <el-button type="primary" @click="handleClick(1)">JAVA</el-button>
      <el-button type="primary" @click="handleClick(2)">前端</el-button>
    </div>
  </template>
  
  <script>
  import reqeust from "@/util/request";
  export default {
    data() {
      return {
        listData: []
      }
    },
    methods: {
      handleClick(parent_fk) {
        reqeust({
          url: "/nav/queryNav",
          method: "POST",
          data: {
            parent_fk
          }
        }).then(res => {
          if (res.data.code > 0) {
            this.listData = res.data.data;
          }
        })
      }
    }
  }
  </script>
  
  <style scoped lang="scss">
  
  </style>